<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <hdjs/>
    </head>
    <body>
    	<div class='wrap'>
    		<div class='title-header'>模板列表</div>
    		<ul>
                <list from="$dirs" name='$d'>
    			<li <if value="$d.current">class='current'</if> dir='{$d.filename}'>
    				<div><img src="{$d.image}" alt="" ></div>
    				<p>{$d.config.author.0}</p>
    				<p>{$d.config.email.0}</p>
    			</li>
            </list>
    		</ul>
    	</div>
        <style>
            ul li{
                float:left;
                margin:10px;
                cursor: pointer;
                background: #ececec;
            }
            ul li.current{
                border:solid 1px #ccc;
            }
             ul li.current img{
                  opacity: 1;
            }
            ul li img{
                border:solid 1px #ccc;
                width:200px;
                height:200px;
                opacity: 0.4;
                margin-bottom: 5px;
            }
            ul li p{
                text-align: center;
                color:#333;
            }
        </style>
        <script>
            $('ul li').click(function(){
                var dirName=$(this).attr('dir');
                $.post(CONTROLLER+'&a=set',{dir:dirName},function(json){
                        alert(json.message);
                        location.reload(true);
                },'json');
            })
        </script>
    </body>
</html>